class Task32:
    def run(self, tree):
        queue = []
        if tree is not None:
            queue.append(tree)
        i = 0
        while i < len(queue):
            node = queue[i]
            if node.left is not None:
                queue.append(node.left)
            if node.right is not None:
                queue.append(node.right)
            i += 1
        return [node.val for node in queue]
